package com.atos.howl.chaos.pdm.mapper;

import com.atos.howl.chaos.pdm.dto.user.UserDTO;
import com.atos.howl.chaos.pdm.entity.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;


public interface UserMapper {
//    @Select("select * from sys_user where user_id = #{id}")
//    User queryUserById(@Param(value = "id") int userId);

    @Insert("insert into sys_user(account,password,user_uuid) VALUES (#{account},#{password},#{uuid})")
    void addUser(User user);

    @Select("select count(*) from sys_user where account = #{account} and password = #{password}")
    int getAccountNumber(@Param("account") String account, @Param("password") String password);

    @Select("select user_uuid from sys_user where account = #{account}")
    String getUUIDByAccount(String account);

    @Select("select * from sys_user where user_uuid = #{uuid}")
    UserDTO getUserInfoByUUID(String uuid);

    @Update("update sys_user set nick_name=#{nickName},sign=#{sign},sex=#{sex},birthday=#{birthday} where user_uuid = #{userUuid}")
    void updateUserInfo(User user);

    String getVideoPlayerLogo();
}
